
This is  a crude but usable user interface(UI) for prpplague's clever SD/MMC Cartridge Hack.
( prpplague's documentation is very good. The only thing he left out was that the write-protect
pad on the XD card must be tied high to allow you to write to the nand.)
The software is mostly just a combination of the test code on the wiki with a few extra routines
to fill in the gaps(like: nandwrite,FAT16 read,scroll,buttons init and controls,mmc GPIO inits...)
The software displays(on the juice box screen) the filenames(8.3) and directories of a FAT16 SDcard and
allows the user to navigate around the files and directories by using the FF and REW buttons on the juice box.
It highlights the current file or directory. If you press the PLAY button while on a directory it will
descend into the directory(displaying the filenames, Its like using the cd command in unix).
If you navigate to file(ie its highlighted) and its extension is .BIN the you can execute the file by
pressing the PLAY button(given that you have set the routine to run at 0x0c001000).
The UI boots from the XD card nand. So it is now possible to easily write and execute files without a
JTAG(once you have SD/MMC Cartridge Hack programmed of course).

Here is a brief description of how I did this:

1)Wrote the the nandwrite routines (this routine is quirky but works well but you unfortunately need a jtag for this step).
(nandwrite will only work from a clean juicebox reboot, I don't know why????)
2)Wrote the init routine for the the mmc GPIO and modified the bitbang SPI routines.
3)Ported ZWS DOSFS (READONLY) to the juice box.(this was the easy part)
4)wrote the UI and scroll routines

I have tested it by executing a small juice box comm program that I wrote which turns the (juice box into a
serial display) and the LCD_2 demo test code. It seems to work fine.

DOSFS is picky about how the sd card is partitioned (I partitioned as FAT16 in linux) but I have written to
it from both Windoze 2000 and linux and it works fine.

in linux you can create a partition on the sd card: 

fdisk /dev/sda

at the command prompt, do

"n" to create a new partition
"p" for primary
"1" for partition 1

Next you need to change the type to FAT16 (assuming you want to use mkdosfs)
at the command prompt, do

"t" to change the type
"1" for partition 1
"6" for FAT16

after that you need to save the changes with "w"

mkdosfs /dev/sda1





The software does very little error checking and the source code is a messy looking,
 but I'm willing to release source code as is (you may have to hold your nose while looking at the code). 

to use the code:
you need to untar ungzip fatjbox.tgz      (tar -zxvf  fatjbox.tgz)

do the usual:
             make -f fatjbox.mak            (edit the make file to fit your toolchain) or just use my fatjbox.elf 

make the bootable nand image like the testcode

Use your favorite juice box nand write routine to flash the nand on the  SD/MMC Cartridge Hack
(Just kidding!  You can use my nandwrite  routine)

Put the  SD/MMC Cartridge Hack in the juice box and turn it on. Hopefully you will see your files names displayed on the screen

I hope that someone makes a printed circuit with the same layout as the SD/MMC Cartridge Hack so that
others can more easily make use of this software.
-unix_guy